#include "os_port.h"
#include "os_tsk.h"
#include "xn5106x.h"
#include "drv_all.h"



/*
	Tick ISR procedure 
 
*/

void  isOS_HalTickIsr( void )
{
	rINTPEND = ~BIT_T0MC;
	isOS_TickIncrement();
#if 0
	{
		if ( 0==(isOS_TickCountGet()&0x0000003F ) )
		{	// about 0.5s toggle
			drv_sys_led_toggle( LED_SYS_ID );
		}
	}
#endif
}


/*
* Function Name:
*   isOS_HalTickSetup
* Description:
*   
* Parameters:
* Returns:
* Author				Date 
*  Jerry				2009-9-16   
* Note:
*    
*/
void isOS_HalTickSetup( void )
{
#if 1
    drv_int_isr_set( INT_NUM_T0MC, isOS_HalTickIsr );
	drv_tmr_set( TMR0_OS, OS_nUS_PER_TICK );  /* 10ms */
	drv_tmr_ena( TMR0_OS, TRUE );
    drv_int_ena( INT_NUM_T0MC, TRUE );
#endif
}


/*
* Function Name:
*   isOS_HalNOP
* Description:
*   HAL NOP operation
* Parameters:
* Returns:
* Author				Date 
*  Jerry				2009-10-21   
* Note:
*    
*/
void isOS_HalNOP( void )
{
	isOS_S32 i = 2;
	while(i--);
}

//----------------------------------------------------------------------------
//----------------------------------------------------------------------------

